<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="postAjaxUploadPic.php" method="post" enctype="multipart/form-data" id="uploadPic">
    <table width="70%" align="center" border="1" bordercolor="gray" cellpadding="15" cellspacing="0" style="border-collapse: collapse">
        <tr>
            <td align="right">车辆图片</td><td><input type="file" name="carPIC"><input type="hidden" name="MAX_FILE_SIZE" value="1048576"><span>图片类型只能是JPG、PNG、GIF。大小不通过1MB。</span><input type="hidden" name="carID" value="<?php echo $_GET['carID'];?>" </td>
        </tr>
        <tr>
            <td align="right"><input type="button" onclick="upload()" value="提交"></td><td><input type="reset" value="重置"></td>
        </tr>
    </table>
</form>
<script src="js/jq.js"></script>
<script src="js/jquery-form.js"></script>
<script>
    function upload(){
        $("#uploadPic").ajaxSubmit({
            dataType:'json',
            success:function (d){
                if(d.code == -1){
                    alert(d.msg);
                    window.parent.close(1,'');
                }
                else {
                    window.parent.close(2,d.pic);
                }
            }
        })
    }
</script>
</body>
</html>